import Mock from 'mockjs'
Mock.setup({
    timeout: 500
})
//生成随机数据
Mock.mock(" http://localhost:3000/lay/api", function () {
    let res = Mock.mock({
        "code": 0,
        "msg": "",
        "result": {
            "list|4": [{
                "id|+1": 1,
                "volume|1-100": 50,
                "medium|1": ['液氯', '氯气', '氨气', '氨水'],
                "morphology|1": ['固体', '气体', '液体'],
                "pressureType|1": ['低压罐', '常压罐', '高压罐'],
                "designPressure|50-150": 30,
                "maxPressure|1": [90, 100, 130, 150],
                "temperatureType|1": ['常温罐', '低温罐', '高温罐'],
                "designTemperature|1": [800, 900, 1000, 1200],
                'designTemperatureLimit|1': [1200, 1000],
                'temperature': '@float(-500, 1000, 1, 3)',
                'liquidLevel': '@float(200, 1000, 1, 3)',
                "pressure": '@float(0, 100, 1, 3)'
            }],
            "page": 1,
            "page_size": 1,
            "total": 100
        }
    })
    return res
})
Mock.mock(" http://localhost:3000/lay/query", function () {
    let res = Mock.mock({
        "code": 0,
        "msg": "",
        "result": {
            "obj|1": [{
                "realValue": "@float(0, 1200, 1, 3)",
                "maxLimit|1": [2000, 1500, 3000, 2500],
                "upLimit|1": [1300, 1400, 1200, 2500],
                "downLimit|1": [100, 300, 50, 80],
                "minLimit|1": [10, 20, 30, 70],
                "rangeMin|1": [0, 10, 20, 30, 70, 100],
                "rangeMax|1": [8000, 3300, 4000, 2500],
                "acquisitionTime": '@datetime'
            }]
        }
    })
    return res
})